/*==============================================================*/
/* Table: {organ.code}_MSG                                              */
/*==============================================================*/
CREATE TABLE {organ.code}_MSG (
   ID                   bigint                  NOT NULL,
   LOGIC_ID             bigint                  NOT NULL,
   ORGAN_LOGIC_ID       bigint                  NOT NULL,
   MSG_TITLE            VARCHAR(500)         NULL,
   MSG_CONTENT          VARCHAR(2000)        NULL,
   SEND_TYPE            VARCHAR(10)          NULL,
   USER_ID              bigint                  NULL,
   USER_NAME            VARCHAR(50)          NULL,
   SEND_TIME            DATETIME             NULL,
   MSG_TYPE             VARCHAR(50)          NULL,
   MSG_URL              VARCHAR(300)         NULL,
   OBJ_ID               bigint                  NULL,
   SYS_CODE             VARCHAR(50)          NULL,
   UPDATE_PERSON        VARCHAR(50)          NULL,
   UPDATE_TIME          DATETIME             NULL,
   EXT1                 VARCHAR(50)          NULL,
   EXT2                 VARCHAR(50)          NULL,
   EXT3                 VARCHAR(50)          NULL,
   EXT4                 VARCHAR(50)          NULL,
   EXT5                 VARCHAR(50)          NULL,
   CONSTRAINT PK_{organ.code}_MSG PRIMARY KEY NONCLUSTERED (ID)
)
go


/*==============================================================*/
/* Table: {organ.code}_MSG_INBOX                                        */
/*==============================================================*/
CREATE TABLE {organ.code}_MSG_INBOX (
   ID                   bigint                  NOT NULL,
   LOGIC_ID             bigint                  NOT NULL,
   ORGAN_LOGIC_ID       bigint                  NOT NULL,
   MSG_LOGIC_ID         bigint                  NOT NULL,
   MSG_STATUS           CHAR(1)              NULL DEFAULT '0',
   USER_ID              bigint                  NULL,
   USER_NAME            VARCHAR(50)          NULL,
   RECEIVE_TIME         DATETIME             NULL,
   MSG_TYPE             VARCHAR(50)          NULL,
   OBJ_ID               bigint                  NULL,
   SYS_CODE             VARCHAR(50)          NULL,
   UPDATE_PERSON        VARCHAR(50)          NULL,
   UPDATE_TIME          DATETIME             NULL,
   EXT1                 VARCHAR(50)          NULL,
   EXT2                 VARCHAR(50)          NULL,
   EXT3                 VARCHAR(50)          NULL,
   EXT4                 VARCHAR(50)          NULL,
   EXT5                 VARCHAR(50)          NULL,
   CONSTRAINT PK_{organ.code}_MSG_INBOX PRIMARY KEY NONCLUSTERED (ID)
)
go

